Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jsii/spec

Package Overview
Dependencies
Maintainers
0
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsii/spec

Specification for jsii assemblies

  • 1.106.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created

What is @jsii/spec?

@jsii/spec is a package that provides TypeScript interfaces and JSON schema definitions for the jsii specification. It is used to define and validate the structure of jsii assemblies, which are used to enable interoperability between different programming languages.

What are @jsii/spec's main functionalities?

TypeScript Interfaces

This feature allows you to define and work with jsii assemblies using TypeScript interfaces. The code sample demonstrates how to create a basic jsii assembly object.

import { Assembly } from '@jsii/spec';

const assembly: Assembly = {
  schema: 'jsii/0.10.0',
  name: 'my-package',
  version: '1.0.0',
  description: 'A sample jsii package',
  license: 'Apache-2.0',
  dependencies: {},
  bundled: [],
  types: {},
  targets: {}
};
console.log(assembly);

JSON Schema Definitions

This feature provides JSON schema definitions for jsii assemblies, allowing you to validate the structure of your jsii assembly objects. The code sample demonstrates how to use the Ajv library to validate a jsii assembly object against the schema.

const schema = require('@jsii/spec/schema.jsii.json');

const validate = (data) => {
  const Ajv = require('ajv');
  const ajv = new Ajv();
  const validate = ajv.compile(schema);
  const valid = validate(data);
  if (!valid) console.log(validate.errors);
  return valid;
};

const data = {
  schema: 'jsii/0.10.0',
  name: 'my-package',
  version: '1.0.0',
  description: 'A sample jsii package',
  license: 'Apache-2.0',
  dependencies: {},
  bundled: [],
  types: {},
  targets: {}
};

console.log(validate(data));

Other packages similar to @jsii/spec

FAQs

Package last updated on 16 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc